package com.dhy.demo

import com.dhy.cp.ComponentProcessorUtil
import org.junit.Test
import java.io.File

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun updateComponents() {
        val annotation = "com.dhy.demo.Component"
        val packageName = annotation.substring(0, annotation.lastIndexOf("."))
        val path = annotation.replace(".", "/")
        val dir = File("src/main/java")
        val componentFile = File(dir, "$path.java")
        val componentsFile = File(dir, "${path}s.java")
        ComponentProcessorUtil.update(packageName, componentsFile, componentFile, "App2", listOf("com.dhy.demo.MainActivity","MainActivity2"))
    }
}